#ifndef FKCLIENTOBJECTMANAGER_H
#define FKCLIENTOBJECTMANAGER_H

#include "FKAbstractObjectManager.h"

#include "FKApplication_global.h"

class FKClientManager;
class FKFileReciever;

class FKAPPLICATIONSHARED_EXPORT FKClientObjectManager:public FKAbstractObjectManager{
    Q_OBJECT
public:
    FKClientObjectManager();
    ~FKClientObjectManager();
    bool connectToServer(QString ip, int port);
public slots:
    void fileRequest(QString fl);
    void interruptFilesDownloading();
signals:
    void disconnected();
    void bytesRecieved(QString file, qint64 size);
    void fileRecieved(QString file);
    void fileError(QString file);
private slots:
    virtual void action(FKEvent* action);
    virtual void externalEvent(FKEvent* event);
    virtual void clientRequested(QString clientName, QString password);
    virtual void getClient(QString clientName, QString password, FKClientManager* s);
    virtual void genClient(QString clientName, QString password, QVariant validator);

    void errorMessage(QString file, QString message);
private:
    virtual void returnMessage(qint32 clientID, QString text);
    FKClientManager* _server;
    FKFileReciever* _fileReciever;
};

#endif // FKCLIENTOBJECTMANAGER_H
